package com.lz.sports

import chen.you.comm.log.LogUtils
import com.lz.library.extension.stackString
import kotlinx.coroutines.CoroutineExceptionHandler
import kotlin.coroutines.CoroutineContext

/**
 *  author: you : 2021/11/16
 */
class GlobalCoroutineExceptionHandler : CoroutineExceptionHandler {

    override val key: CoroutineContext.Key<*>
        get() = CoroutineExceptionHandler

    override fun handleException(context: CoroutineContext, t: Throwable) {
        LogUtils.e("GlobalCoroutineExceptionHandler", t.stackString())
    }

}